package zuoye1;

public class Demo8 {
    public static void main(String[] args) {
        int j = 0;
        for (int i = 1; i < 1000; i++) {
            if (i%3==0&&i%5==0){
                System.out.print(i + ",");
                j++;
                if (j%4==0){
                    System.out.println();
                }
            }
        }
        System.out.println("1到1000之间既能被5整除又能被3整除的数" +
                "一共有" + j + "个");
    }
}
